/****************************************************************/
/*                        Instruction                           */
/* This is the AD Material applying the necessary parameters      */
/* to simulate heat conduction and pyrolysis progress .         */
/* the pyrolysis model is single-phase Arrhenius relation(pyrolysis area,not surface model) .         */
/* the first version did not include pyrolysis gas properties(created at 2017.04.21)*/


#pragma once

#include "Material.h"
#include "LinearInterpolation.h"

class Function;

class SinglePhasePyrolysisADMaterial : public ADMaterial
{
public:
	SinglePhasePyrolysisADMaterial(const InputParameters& parameters);

protected:

	ADReal Source(ADReal rho, ADReal T, Real T_begin, Real rhoc, Real rhov, Real precoff, Real ER, Real reaction_level);
	virtual void computeProperties();
	std::string _rho_name;
	ADMaterialProperty<Real>& _pyrolysis_source;
   //get varialbles
	const ADVariableValue& _T_value;
	const ADVariableValue& _rho_value;
	//get Regular thermal properties
	Real  _rho_i_v_value;
	Real  _rho_i_c_value;
	//get special parameters to compute pyrolysis Arrhenius relation
	Real  _T_begin_value;
	Real  _precoff_value;
	Real  _ER_value;
	Real  _reaction_level_value;
};

template<>
InputParameters validParams<SinglePhasePyrolysisADMaterial>();
